#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,i;
	double x[100000],y[100000];
	cin>>n;
	for(i=1;i<=n;i++)
	{
		cin>>x[i];
		if(x[i]<-1) y[i]=x[i]*x[i]-sin(x[i]);
		if(-2<=x[i]&&x[i]<=2) y[i]=pow(2,x[i])+x[i];
		if(x[i]>2) y[i]=sqrt(x[i]*x[i]+x[i]+1);
	}
	for(i=1;i<=n;i++)
	printf("%.2f ",y[i]);
    return 0;
}
